package function;

public class Constant extends Function {

	private double constant;

	public Constant(double c) {
		constant = c;
	}

	public double getConstant() {
		return constant;
	}

	public void setConstant(double constant) {
		this.constant = constant;
	}

	public double evaluate(double x) {
		return constant;
	}

	public Function differentiate() {
		return new Constant(0);
	}

	public String toString() {
		if (constant == Math.E)
			return "e";
		return constant + "";
	}

}
